#include "Settings.h"

class EventReceiver : public IEventReceiver {
public:
	EventReceiver();
	~EventReceiver() {}
	struct SMouseState {
		position2di Position;
		bool LeftButtonDown;
		bool LeftButtonClicked;
		bool LeftButtonfloatClicked;
		bool RightButtonDown;
		bool RightButtonClicked;
		bool RightButtonfloatClicked;
		f32 WheelValue;
		SMouseState() : LeftButtonDown(false),
			LeftButtonfloatClicked(false),
			RightButtonDown(false),
			RightButtonfloatClicked(false),
			WheelValue(0) {}
		} MouseState;
    const SEvent::SJoystickEvent &GetJoystickState(int Joystick_Number) {
            return JoystickStates[Joystick_Number];
    }
	const SMouseState &GetMouseState(void) {
		return MouseState;
    }
	void ActivateJoysticks(IrrlichtDevice *Device);
	const bool IsButtonClicked(int Joystick_Number, int Button_Number);
	const bool IsJoystickActive();
    virtual const bool IsKeyClicked(EKEY_CODE Key_Code);
    virtual const bool IsKeyDown(EKEY_CODE Key_Code);
	virtual bool OnEvent(const SEvent& event);
	void SetButtonClickArray(int Joystick_Number, core::array<SJoystickInfo> Joystick_Info);
	void SetNumberOfJoysticks(int Number);
	array<SJoystickInfo> JoystickInfo;
private:
	bool JoystickActive;
	vector<bool> JoystickStateClicked1;
	vector<bool> JoystickStateClicked2;
    vector<SEvent::SJoystickEvent> JoystickStates;
	bool KeyIsClicked[KEY_KEY_CODES_COUNT];
	bool KeyIsDown[KEY_KEY_CODES_COUNT];
};